#if !defined(__Particle_h__)
#define __Particle_h__

// Include GLM - OpenGL Mathematics
#include <glm/glm.hpp>
#include <glm/gtc/matrix_transform.hpp>
#include <vector>

using namespace glm;

class Particle
{
public:
	//
	Particle(vec3 position);
	Particle();
	//
	void addForce(vec3 f);        // For updating the acceleration using the equation "acceleration = acceleraiton + force / mass";
	void timeStep(float damping); // Finds next position through verlet integration using the equation "force = mass * acceleration" 
	float getID();                // Each particle has a unique id to identify it
	vec3& getPosition();
	void setPosition(vec3&);
	vec3& getOldPosition();
	void setOldPosition(vec3&);
	vec3& getAcceleration();
	void setAcceleration(vec3&);
	void resetAcceleration();
	void offsetPosition(const vec3 v);
	void makeUnmovable();
	void addToNormal(vec3 normal);
	vec3& getNormal();
	void resetNormal();
	bool isUpdatedFromTransFeed();
	void resetFirstTimeUpdFromTransFeed();
	void setFirstTimeUpdFromTransFeed(bool val);
	bool isMovable(){return m_bMovable;}
	//
private:
	float m_nID;
	bool m_bMovable;                   // Determines if the particle can move or not
	float m_nMass;                     // The mass of the particle
	vec3 m_position;                   // Current position of the particle
	vec3 m_oldPosition;                // Position of the particle in the previous time step, needed for verlet integration technique
	vec3 m_acceleration;               // Current acceleration of the particle
	vec3 m_accumulatedNormal;          // Smoothed normal
	bool m_bFirstTimeUpdFromTransFeed; // Used for updating particle after transform feedback (gravity force)
};

#endif // __Particle_h__